Hello,
I am very new to the dynomotion products and to this forum. For the last few weeks I have been playing with my kflop/kanalog boards as well as the kmotion software. Up til now I have been emailing (or should I say driving crazy) Tom direct and he has been a BIG help.
I have now ran into a pretty big stumbling block. I have a machine with a X (with B slaved), Y and A axes. Below is a snippet of a simple home routine that works ok. In this program I am just homing to the switches and slightly moving inside once they are all found. I am also letting the "B" slave just home along with the "X" master.
Jog(0,-3000); // start moving x
while (!ReadBit(136)) ; // wait for switch
Jog(0,0); // stop
Zero(0); //zero x
Jog(1,-3000); // start moving y
while (!ReadBit(137)) ; // wait for switch
Jog(1,0); // stop
Zero(1); //zero y
Jog(3,-800); // start moving a
while (!ReadBit(139)) ; // wait for switch
Jog(3,0); // stop
Zero(3); //zero a
Move(0,500); // move x inside
Move(1,500); // move y inside
Move(3,400); // move a inside
Here is where my trouble starts: I would like to incorporate the "B" slave in to the home sequence and pieced together this snippet:
{
int found0,found1;
Jog(0,-1000); // start moving both axis toward switches
Jog(4,-1000);
found0 = found1 = 0;
while (!found0 || !found1)
{
if (ReadBit(136))
{
Jog(0,0.0); // StopMotion
found0=1;
}
if (ReadBit(138))
{
Jog(1,0.0); // StopMotion
found1=1;
}
}
}
Once the master axis tags its home switch it will stop but the slave axis continues and drives past its home switch.
I am very familiar with Mach3 and vbscripts but haven't a clue about C programming. Any help would be very much appreciated.
TIA,
Allen
|